import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
var _excluded = ["className", "content", "description", "descriptions", "comment", "btns", "itemIcon", "icon", "iconType", "maxLen", "style"];

/* eslint-disable react/require-default-props */

/**
 * MaxLenItem.js
 * @date 2018/11/26
 */
import React from 'react';
import { Icon } from 'antd';
import styles from "../index.less?modules";

var MaxLenItem = /*#__PURE__*/function (_React$Component) {
  _inherits(MaxLenItem, _React$Component);

  var _super = _createSuper(MaxLenItem);

  function MaxLenItem() {
    var _this;

    _classCallCheck(this, MaxLenItem);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _super.call.apply(_super, [this].concat(args));
    _this.state = {};
    return _this;
  }

  _createClass(MaxLenItem, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          className = _this$props.className,
          content = _this$props.content,
          description = _this$props.description,
          descriptions = _this$props.descriptions,
          comment = _this$props.comment,
          _this$props$btns = _this$props.btns,
          btns = _this$props$btns === void 0 ? [] : _this$props$btns,
          itemIcon = _this$props.itemIcon,
          icon = _this$props.icon,
          iconType = _this$props.iconType,
          maxLen = _this$props.maxLen,
          style = _this$props.style,
          other = _objectWithoutProperties(_this$props, _excluded);

      var iconItem = icon || /*#__PURE__*/React.createElement(Icon, {
        type: iconType
      });
      var itemClassName = styles['max-len-item'];

      if (className) {
        itemClassName += " ".concat(className);
      }

      var iconElement = itemIcon === undefined ? /*#__PURE__*/React.createElement("div", {
        className: styles['max-len-item-icon']
      }, iconItem) : itemIcon;
      return /*#__PURE__*/React.createElement("div", Object.assign({
        className: itemClassName
      }, other), iconElement, /*#__PURE__*/React.createElement("div", {
        className: styles['max-len-item-content-wrapper']
      }, /*#__PURE__*/React.createElement("div", {
        className: styles['max-len-item-main-content-wrapper']
      }, descriptions ? /*#__PURE__*/React.createElement("div", {
        className: styles['max-len-item-descriptions']
      }, descriptions) : /*#__PURE__*/React.createElement("div", {
        className: styles['max-len-item-description']
      }, description), /*#__PURE__*/React.createElement("div", {
        className: styles['max-len-item-content']
      }, content)), /*#__PURE__*/React.createElement("div", {
        className: styles['max-len-item-comment']
      }, comment)), /*#__PURE__*/React.createElement("div", {
        className: styles['max-len-item-btns']
      }, btns));
    }
  }]);

  return MaxLenItem;
}(React.Component);

MaxLenItem.defaultProps = {
  comment: '',
  content: ''
};
export { MaxLenItem as default };